package com.firefly.admin.login.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

@ApiModel(value = "RouterInfoVo", description = "路由信息")
@Data
@ToString
@EqualsAndHashCode
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class RouterInfoVo {

    @ApiModelProperty(value = "路由名称")
    private String name;

    @ApiModelProperty(value = "路由路径")
    private String path;

    @ApiModelProperty(value = "结构")
    private String component;

    private String redirect;

    @ApiModelProperty(value = "是否隐藏")
    private Boolean hidden;

    @ApiModelProperty(value = "权限信息")
    private Meta meta;

    @ApiModelProperty(value = "子节点")
    private List<RouterInfoVo> children = new ArrayList<>();

    @Data
    @AllArgsConstructor
    public static class Meta {

        @ApiModelProperty(value = "标题")
        private String title;

        @ApiModelProperty(value = "图标")
        private String icon;

        @ApiModelProperty(value = "权限信息")
        private String[] roles;

        private boolean noCache;
    }
}
